import request from '@/utils/request'

// 查询用户订阅消息源列表
export function listMessageSourceRelation(query) {
  return request({
    url: '/coal/messageSourceRelation/list',
    method: 'get',
    params: query
  })
}

// 查询用户订阅消息源详细
export function getMessageSourceRelation(id) {
  return request({
    url: '/coal/messageSourceRelation/' + id,
    method: 'get'
  })
}

// 新增用户订阅消息源
export function addMessageSourceRelation(data) {
  return request({
    url: '/coal/messageSourceRelation',
    method: 'post',
    data: data
  })
}

// 修改用户订阅消息源
export function updateMessageSourceRelation(data) {
  return request({
    url: '/coal/messageSourceRelation',
    method: 'put',
    data: data
  })
}

// 删除用户订阅消息源
export function delMessageSourceRelation(id) {
  return request({
    url: '/coal/messageSourceRelation/' + id,
    method: 'delete'
  })
}

// 用户订阅消息源查询
export function getSubscribeRelation(id) {
  return request({
    url: '/coal/messageSourceRelation/getSubscribe/' + id,
    method: 'get'
  })
}

// 保存多用户订阅消息源
export function saveSubscribeRelation(data) {
  return request({
    url: '/coal/messageSourceRelation/subscribe',
    method: 'post',
    data: data
  })
}

// 删除用户订阅消息源
export function deleteByMessageSourceId(data) {
  return request({
    url: '/coal/messageSourceRelation/delete',
    method: 'delete',
    data: data
  })
}
